Skip to content

Manchester | 26-ITP-Jan | Ofonime Edak| Sprint 3 | Dead Code#1232

Open
Ofonimeedak wants to merge 8 commits intoCodeYourFuture:mainfrom
Ofonimeedak:coursework/dead-code
Open

Manchester | 26-ITP-Jan | Ofonime Edak| Sprint 3 | Dead Code#1232
Ofonimeedak wants to merge 8 commits intoCodeYourFuture:mainfrom
Ofonimeedak:coursework/dead-code

Conversation

@Ofonimeedak
Copy link

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Changes to file exercise-1.js: Identifying redundant code
Changes to file exercise-2.js: Identifying redundant code
Removing all redundant/dead code and testing the function

@Ofonimeedak Ofonimeedak added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Structuring-And-Testing-Data The name of the module. labels Mar 8, 2026
@SlideGauge SlideGauge added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Mar 15, 2026
Copy link

@SlideGauge SlideGauge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description of the task says "One pull request for the 3-dead-code directory."
Could you adjust your pull request according to the task please?

testName = "Aman";

const greetingMessage = sayHello(greeting, testName);
const greetingMessage = sayHello('hello', 'Aman!');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will there be a difference between the output with these arguments compared to the initial arguments?

console.log(greetingStr);
}

testName = "Aman";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is normal to put arguments themselves into variables and, better, constants, instead of pasting raw literals into function arguments. These raw literals are called "magic numbers"/"magic strings" respectively and typically should be avoided.

const greeting = "hello";

function sayHello(greeting, name) {
const greetingStr = greeting + ", " + name + "!";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: after we removed the console.log on the line 10, what is the remaining purpose of this string?

const capitalisedPets = pets.map((pet) => pet.toUpperCase());
const petsStartingWithH = pets.filter((pet) => pet[0] === "h");

function logPets(petsArr) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you analyse please who's calling this function in the file?

@SlideGauge SlideGauge added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Mar 15, 2026
@SlideGauge
Copy link

There are several things worth fixing, could you do it please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Structuring-And-Testing-Data The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants